package Expe6;

import java.util.Scanner;

/**
 * @Author sy
 * @Date 2022/9/27
 */
public class Expe6T3 {
}
class Vehicle{
    double speed;
    double size;
    public void Vehicle(double speed,double size){
        this.speed=speed;
        this.size=size;
    }
    void move(){

    }
    void setSpeed(int speed){
        this.speed=speed;
    }
    void setSize(int size){
        this.size=size;
    }
    void speedUp(){
        System.out.println("请输入要加速多少：");
        Scanner sc = new Scanner(System.in);
        double su = sc.nextDouble();
        this.speed=speed+su;

    }
    void SpeedDown(){
        System.out.println("请输入要减速多少：");
        Scanner sc = new Scanner(System.in);
        double sd = sc.nextDouble();
        this.speed=speed-sd;
    }
    void printInfor(){

        System.out.println("当前速度为："+speed);
        System.out.println("当前体积为："+size);
    }
}
